<?php


namespace api\controllers;

use Yii;
use yii\web\Controller;

/**
 * Site controller
 */
class SiteController extends Controller
{
    public function actionError()
    {
        $exception = Yii::$app->errorHandler->exception;

        $data['success']    = false;
        $data['code']       = $exception->statusCode;
        $data['message']    = Yii::$app->params['codes'][$data['code']];

        echo  json_encode($data);exit;
    }
}
